package main

import (
	"fmt"
	"inkjet168x-sdk-go/sdk"
)

func main() {
	fmt.Println("=== 命令包SDK使用示例 ===\n")
	
	// 创建命令包SDK实例
	workcodeSDK := sdk.NewWorkcodeSDK()
	
	// 示例1: 启动命令
	fmt.Println("示例1: 生成启动命令协议")
	protocol1 := workcodeSDK.NewWorkcodeProtocol()
	protocol1.SetCommand(uint32(256), uint32(0))
	protocol1.SetSequence(uint16(0))
	
	data1, err := workcodeSDK.CreateWorkcodeProtocol(protocol1)
	if err != nil {
		fmt.Printf("错误: %v\n", err)
		return
	}
	
	fmt.Printf("启动命令协议数据包 (%d 字节): ", len(data1))
	for i := 0; i < len(data1); i++ {
		fmt.Printf("%02X ", data1[i])
	}
	fmt.Println()
}